pp108 : remove Method

remove Method


This method removes an option from the drop-down menu or list.

Syntax

Scripting

controlID.remove(oOption)


Parameters

Parameter

Description

oOption

Required. Index of option or option object that denotes the option to be removed.


Example


A sample code that shows how the above property is used is as follows:

//function removes two options from the dropdown. The first by passing an index, and
//the next by passing an object.
function removeItems()
     {
          var index = myFruitSelect.getSelectedIndex();
          var option = myFruitSelect.getOptions()[index];
          myFruitSelect.remove(option);
          application.notify("Selected option removed");
          //Removes first option
          myFruitSelect.remove(0);
          application.notify("First option removed");
      }

See Also


Dropdown, Listbox